<?php echo $this->fetch('header.html'); ?>

<?php echo $this->fetch('title.html'); ?>

<style>
    #coupon{background: #fff;}
    #coupon .coupon_list h2{height:40px;line-height:40px;padding-left:10px;font-size:14px;}
    #coupon .coupon_list h2 a{color: #ff5c5b;}
    #coupon .coupon_list ul{}
    #coupon .coupon_list ul li{padding: 8px 10px 9px 10px;border-bottom: 1px solid #f5f5f5;height: 80px;}
    #coupon .coupon_list ul li .pic{width: 100px;height: 80px;margin: 0px 12px 0 0;display: inline-block;overflow: hidden;position: relative;float:left;}
    #coupon .coupon_list ul li .info{float:left;}
    #coupon .coupon_list ul li .info p{font-size: 12px;height:25px;line-height:25px;overflow: hidden;}
</style>

<section id="coupon">
    <?php $_from = $this->_var['store_list']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('', 'store');$this->_foreach['fe_store'] = array('total' => count($_from), 'iteration' => 0);
if ($this->_foreach['fe_store']['total'] > 0):
    foreach ($_from AS $this->_var['store']):
        $this->_foreach['fe_store']['iteration']++;
?>
    <div class="coupon_list">
        <h2>店铺：<a href="<?php echo url('app=store&act=coupon&id=' . $this->_var['store']['store_id']. ''); ?>"><?php echo $this->_var['store']['store_name']; ?></a></h2>
        <ul class="list">
            <?php $_from = $this->_var['store']['coupons']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('', 'coupon');$this->_foreach['fe_coupon'] = array('total' => count($_from), 'iteration' => 0);
if ($this->_foreach['fe_coupon']['total'] > 0):
    foreach ($_from AS $this->_var['coupon']):
        $this->_foreach['fe_coupon']['iteration']++;
?>
            <a href="<?php echo url('app=coupon&act=view&id=' . $this->_var['coupon']['coupon_id']. ''); ?>">
                <li>
                    <div class="pic">
                        <img src="<?php echo $this->_var['site_url']; ?>/<?php echo $this->_var['coupon']['coupon_bg']; ?>" width="100" height="80" />
                    </div>
                    <div class="info">
                        <p><?php echo local_date("Y-m-d",$this->_var['coupon']['start_time']); ?> 至 <?php if ($this->_var['coupon']['end_time']): ?><?php echo local_date("Y-m-d",$this->_var['coupon']['end_time']); ?><?php else: ?>不限制<?php endif; ?></p>
                        <p>满<?php echo price_format($this->_var['coupon']['min_amount']); ?></p>
                        <p>可抵扣<?php echo price_format($this->_var['coupon']['coupon_value']); ?></p>
                    </div>
                </li>
            </a>
            <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?>
        </ul>
    </div>
    <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?>
    <?php echo $this->fetch('page.bottom.html'); ?>
</section>
<?php echo $this->fetch('footer.html'); ?>